Skip to content

ILLDEV-277 Add patron request events endpoint#399

Merged
JanisSaldabols merged 2 commits intomainfrom
ILLDEV-277
Feb 13, 2026
Merged

ILLDEV-277 Add patron request events endpoint#399
JanisSaldabols merged 2 commits intomainfrom
ILLDEV-277

Conversation

@JanisSaldabols
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new endpoint to retrieve events associated with a specific patron request. The implementation follows established patterns in the codebase and includes comprehensive test coverage.

Changes:

  • Added /patron_requests/{id}/events GET endpoint to retrieve patron request related events
  • Implemented repository method GetPatronRequestEvents to query events by patron request ID
  • Added patronRequestID field to Event schema in OpenAPI specification
  • Updated all handler instantiations to include the event repository dependency

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
broker/oapi/open-api.yaml Added /patron_requests/{id}/events endpoint specification and patronRequestID field to Event schema
broker/sqlc/event_query.sql Added SQL query GetPatronRequestEvents to fetch events by patron request ID ordered by timestamp
broker/events/eventrepo.go Implemented GetPatronRequestEvents method in interface and repository following existing patterns
broker/patron_request/api/api-handler.go Added GetPatronRequestsIdEvents handler and toApiEvent conversion function; updated constructor to accept event repository
broker/app/app.go Updated API handler initialization to pass event repository
broker/test/mocks/mock_eventrepo.go Added mock implementations of GetPatronRequestEvents for success and error scenarios
broker/patron_request/api/api-handler_test.go Added comprehensive unit tests covering missing symbol, DB errors, side validation, and event retrieval errors
broker/test/patron_request/api/api-handler_test.go Added integration test assertions to verify events are returned in the complete workflow test

Copy link
Contributor

@jakub-id jakub-id left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note Copilot comments

@JanisSaldabols JanisSaldabols merged commit 16c02c4 into main Feb 13, 2026
4 checks passed
@JanisSaldabols JanisSaldabols deleted the ILLDEV-277 branch February 13, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants